{include file="header.html"}
<div id="page_main" class="main-right">
  <div id="rightTop">
    <p>{$lang.template_setting}</p>
    <p><a class="red" href="javascript:clear_file();">{$lang.clear_file}</a></p>
    <ul class="subnav">
      <!--{if $smarty.get.client eq 'wap'}-->
      <li><a class="btn1" href="{url route='template/index'}">{$lang.pc_theme}</a></li>
      <li><span>{$lang.wap_theme}</span></li>
      <!--{else}-->
      <li><span>{$lang.pc_theme}</span></li>
      <li><a class="btn1" href="{url route='template/index' client='wap'}">{$lang.wap_theme}</a></li>
      <!--{/if}-->
    </ul>
  </div>
  <ul id="rightCon" class="page-template clearfix">
    <!--{foreach from=$pages item=page key=key}-->
    <li>
      <div class="page_item">
        <h3>{$page.title}</h3>
        <div>
          <form action="{url route='template/edit'}" target="_blank">
            <input type="hidden" name="r" value="template/edit" />
            <input type="hidden" name="client" value="{$client}" />
            <input type="hidden" name="page" value="{$key}" />
            <input type="submit" class="submit" value="{$lang.visual}" />
            <input type="button" class="preview" url="{$page.url}" value="{$lang.preview}" />
            <!--{foreach from=$page.action item=action}-->
            <input type="button" class="{$action}" id="{$key}" value="{$lang.$action}" />
            <!--{/foreach}-->
          </form>
        </div>
      </div>
    </li>
    <!--{/foreach}--> 
    <!--{if $client eq 'pc'}-->
    <li> <a class="page_item" href="{url route='channel/add'}">
      <div style="height:110px; font-size:40px; line-height:110px; font-weight:100">+</div>
      </a> </li>
    <!--{/if}-->
  </ul>
</div>
<script>
$(function(){
	$('input.preview').click(function(){
		window.open($(this).attr('url'));
	});
	$('input.edit').click(function(){
		window.location.href = url(['channel/edit', { id:$(this).attr('id')}]);
	});
	$('input.drop').click(function(){
		if(confirm('{$lang.drop_confirm}')){
			window.location.href = url(['channel/delete', { id:$(this).attr('id')}]);
		}
	});
});
</script> 
{include file="footer.html"} 